package com.aimo.base.exceptiondemo.core;

import com.aimo.base.exceptiondemo.http.HttpStatus;

/**
 * @Author: lmy
 * @Date: 2021/2/19 13:47
 * @Description: 业务异常类
 */
public class BizException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private HttpStatus httpStatus;

    public BizException() {
        super();
    }

    public BizException(HttpStatus httpStatus) {
        super(httpStatus.getValue());
        this.httpStatus = httpStatus;
    }

    public BizException(HttpStatus httpStatus, Throwable cause) {
        super(httpStatus.getValue(), cause);
        this.httpStatus = httpStatus;
    }

    public HttpStatus getHttpStatus() {
        return httpStatus;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }

}
